﻿<controls:ChildWindow x:Class="CalculationDemo.OilNetwrokCalculate"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"  
    Width="1200" Height="850" 
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot">
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="20*"/>
            <ColumnDefinition Width="80*"/>
        </Grid.ColumnDefinitions>
        
        <ScrollViewer>
            <StackPanel>
                <sdk:DataGrid ItemsSource="{Binding UnitListForTest}" AutoGenerateColumns="False" Loaded="DataGrid_Loaded">
                <sdk:DataGrid.Columns>
                    <sdk:DataGridTextColumn Header="Name"   Binding="{Binding UnitName}"  />
                    <sdk:DataGridTextColumn Header="C"      Binding="{Binding Capacity}"  />
                    <sdk:DataGridTextColumn Header="RC"     Binding="{Binding RealCapacity}"  />                    
                    <sdk:DataGridTextColumn Header="EC"     Binding="{Binding EffectiveCapacity}"  />
                </sdk:DataGrid.Columns>
            </sdk:DataGrid>            
                <!--<Button Content="Calculate" Click="Button_Click"  
                    Width="150" Margin="0,20,0,0"></Button>-->            
                <TextBlock Text="C  : Capacity"  FontWeight="Bold" FontSize="12" Margin="2,5,0,0"/>
                <TextBlock Text="RC : Real Capacity"  FontWeight="Bold" FontSize="12" Margin="2,5,0,0"/>
                <TextBlock Text="EC : Effective Capacity" FontWeight="Bold" FontSize="12" Margin="2,5,0,0"/>
            </StackPanel>
        </ScrollViewer>
        
        <telerik:RadDiagram Grid.Column="1" x:Name="fieldDiagram">
            
            <telerik:RadDiagramShape x:Name="Radial1" Content="Radial1"
                                     Background="LightGreen" Width="100" Height="70"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="800,300">               
            </telerik:RadDiagramShape>

            <telerik:RadDiagramConnection x:Name="Pipeline1" Content="Pipeline1"
                                          StrokeThickness="2"                                          
                                          Source="{Binding ElementName=Tower1}" Target="{Binding ElementName=Radial1}"
                                          TargetCapType="Arrow1Filled" />
            <telerik:RadDiagramShape x:Name="Tower1" Content="Tower1"
                                     Width="100" Background="LightGreen" FontWeight="Bold" Position="650,100" />
            <telerik:RadDiagramConnection x:Name="Well11" Content="Well11" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well11t}" Target="{Binding ElementName=Tower1}" />
            <telerik:RadDiagramShape x:Name="Well11t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="650,200">
            </telerik:RadDiagramShape>


            <telerik:RadDiagramConnection x:Name="Pipeline2" Content="Pipeline2"
                                          StrokeThickness="2"                                          
                                          Source="{Binding ElementName=Tower2}" Target="{Binding ElementName=Radial1}"
                                          TargetCapType="Arrow1Filled" />
            <telerik:RadDiagramShape x:Name="Tower2" Content="Tower2"
                                     Width="100" Background="LightGreen" FontWeight="Bold" Position="500,500" />
            <telerik:RadDiagramConnection x:Name="Well21" Content="Well21" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well21t}" Target="{Binding ElementName=Tower2}" />
            <telerik:RadDiagramShape x:Name="Well21t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="500,650">
            </telerik:RadDiagramShape>
            <telerik:RadDiagramConnection x:Name="Well22" Content="Well22" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well22t}" Target="{Binding ElementName=Tower2}" />
            <telerik:RadDiagramShape x:Name="Well22t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="620,700">
            </telerik:RadDiagramShape>


            <telerik:RadDiagramConnection StrokeThickness="8"                                          
                                          Source="{Binding ElementName=Tower3}" Target="{Binding ElementName=Radial1}"
                                          />
            <telerik:RadDiagramShape x:Name="Tower3" Content="Tower3"
                                     Width="100" Background="LightGreen" FontWeight="Bold" Position="350,300" />
            <telerik:RadDiagramConnection x:Name="Well31" Content="Well31" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well31t}" Target="{Binding ElementName=Tower3}" />
            <telerik:RadDiagramShape x:Name="Well31t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="350,450">
            </telerik:RadDiagramShape>
            <telerik:RadDiagramConnection x:Name="Well32" Content="Well32" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well32t}" Target="{Binding ElementName=Tower3}" />
            <telerik:RadDiagramShape x:Name="Well32t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="450,500">
            </telerik:RadDiagramShape>


            <telerik:RadDiagramConnection x:Name="Pipeline3" Content="Pipeline3"
                                          StrokeThickness="2"                                          
                                          Source="{Binding ElementName=Tower4}" Target="{Binding ElementName=Tower3}"
                                          TargetCapType="Arrow1Filled" />
            <telerik:RadDiagramShape x:Name="Tower4" Content="Tower4"
                                     Width="100" Background="LightGreen" FontWeight="Bold" Position="200,200" />
            <telerik:RadDiagramConnection x:Name="Well41" Content="Well41" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well41t}" Target="{Binding ElementName=Tower4}" />
            <telerik:RadDiagramShape x:Name="Well41t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="200,20">
            </telerik:RadDiagramShape>
            <telerik:RadDiagramConnection x:Name="Well42" Content="Well42" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well42t}" Target="{Binding ElementName=Tower4}" />
            <telerik:RadDiagramShape x:Name="Well42t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="300,100">
            </telerik:RadDiagramShape>
            


            <telerik:RadDiagramConnection x:Name="Pipeline4" Content="Pipeline4"
                                          StrokeThickness="2"                                          
                                          Source="{Binding ElementName=Tower5}" Target="{Binding ElementName=Tower3}"
                                          TargetCapType="Arrow1Filled" />
            <telerik:RadDiagramShape x:Name="Tower5" Content="Tower5"
                                     Width="100" Background="LightGreen" FontWeight="Bold" Position="200,400" />
            <telerik:RadDiagramConnection x:Name="Well51" Content="Well51" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well51t}" Target="{Binding ElementName=Tower5}" />
            <telerik:RadDiagramShape x:Name="Well51t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="200,550">
            </telerik:RadDiagramShape>
           
            

            <telerik:RadDiagramConnection x:Name="Pipeline5" Content="Pipeline5"
                                          StrokeThickness="2"                                          
                                          Source="{Binding ElementName=Tower6}" Target="{Binding ElementName=Tower4}"
                                          TargetCapType="Arrow1Filled" />
            <telerik:RadDiagramShape x:Name="Tower6" Content="Tower6"
                                     Width="100" Background="LightGreen" FontWeight="Bold" Position="20,100" />
            <telerik:RadDiagramConnection x:Name="Well61" Content="Well61" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well61t}" Target="{Binding ElementName=Tower6}" />
            <telerik:RadDiagramShape x:Name="Well61t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="20,350">
            </telerik:RadDiagramShape>
            <telerik:RadDiagramConnection x:Name="Well62" Content="Well62" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well62t}" Target="{Binding ElementName=Tower6}" />
            <telerik:RadDiagramShape x:Name="Well62t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="110,400">
            </telerik:RadDiagramShape>


            <telerik:RadDiagramShape x:Name="conn" Content=""
                                     Background="Black" Width="8" Height="8"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="310,245"/>
            <telerik:RadDiagramConnection x:Name="Pipeline6" Content="Pipeline6"
                                          StrokeThickness="2"                                          
                                          Source="{Binding ElementName=Tower7}" Target="{Binding ElementName=conn}"
                                          TargetCapType="Arrow1Filled" />
            <telerik:RadDiagramShape x:Name="Tower7" Content="Tower7"
                                     Width="100" Background="LightGreen" FontWeight="Bold" Position="350,100" />
            <telerik:RadDiagramConnection x:Name="Well71" Content="Well71" StrokeThickness="1"                                          
                                          Source="{Binding ElementName=Well71t}" Target="{Binding ElementName=Tower7}" />
            <telerik:RadDiagramShape x:Name="Well71t" Content=""
                                     Background="LightGreen" Width="10" Height="10"  FontWeight="Bold"
                                     Geometry="{telerik:CommonShape ShapeType=EllipseShape}"
                                     Position="450,20">
            </telerik:RadDiagramShape>

        </telerik:RadDiagram>
                
    </Grid>
</controls:ChildWindow>
